{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="{:url('user/customer/remind', ['type' => 1])}" class="layui-btn {if condition="input('type') eq 1 or input('type') eq ''"}layui-btn-danger{/if}"><i class="fa fa-bell-o"></i> 今日待处理</a>
            <a href="{:url('user/customer/remind', ['type' => 2])}" class="layui-btn {if condition="input('type') eq 2"}layui-btn-danger{/if}"><i class="fa fa-bell-o"></i> 全部待处理</a>
            <a href="{:url('user/customer/remind', ['type' => 3])}" class="layui-btn {if condition="input('type') eq 3"}layui-btn-danger{/if}"><i class="fa fa-bell-o"></i> 已处理提醒</a>
            <a href="{:url('user/customer/remind', ['type' => 4])}" class="layui-btn {if condition="input('type') eq 4"}layui-btn-danger{/if}"><i class="fa fa-bell-o"></i> 需二次处理</a>
            <a href="{:url('user/customer/remind', ['type' => 5])}" class="layui-btn {if condition="input('type') eq 5"}layui-btn-danger{/if}"><i class="fa fa-bell-o"></i> 过期未处理</a>
        </div>     
        <table class="layui-table layui-form">
            <thead>
                <tr>
                    <th>提醒时间</th>
                    <th>客户名称</th>
                    <th>手机号码</th>
                    <th>提醒方式</th>
                    <th>提醒备注</th>
                    <th>创建时间</th>
                    {if condition="input('type') neq 1 && input('type') neq ''"}
                    <th>处理时间</th>
                    <th>处理情况</th>
                    {/if}
                    <th>操作人</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {foreach name="list" item="v" empty="$empty"}
                <?php $customer = \app\common\model\Customer::get($v['cid']); ?>
                <tr>
                    <td><?php echo date('Y-m-d',$v['remind_time'])?></td>
                    <td><a href="{:url('user/customer/show', ['id' => $customer.id])}" class="layui-btn layui-btn-normal">{$customer.cname}</a></td>
                    <td>{$customer.mobile}</td>
                    <td>
                        {if isset($v.jdata.web) and $v.jdata.web =='on'}<i class="fa fa-comment" aria-hidden="true" title="后台提醒"></i> {/if}
                        {if isset($v.jdata.wechat) and $v.jdata.wechat =='on'}<i class="fa fa-weixin" aria-hidden="true" title="微信提醒"></i> {/if}
                        {if isset($v.jdata.sms) and $v.jdata.sms =='on'}<i class="fa fa-envelope-open" aria-hidden="true" title="短信提醒"></i> {/if}
                    </td>
                    <td>{$v.remark}</td>
                    <td>{:time_trans($v['create_time'])}</td>
                    {if condition="input('type') neq 1 && input('type') neq ''"}
                    <td>{:time_trans($v['status_time'])}</td>
                    <td>{$v.status_remark|default='无'}</td>
                    {/if}
                    <td>{:get_user_realname($v['uid'])}</td>
                    <td>
                        {if $v['status']=='0'}
                        <a href="{:url('user/customer/set_remind', ['id' => $v.id])}" class="layui-btn layui-btn-normal"><i class="fa fa-edit"></i> 未处理</a>
                        {else}
                        <a href="{:url('user/customer/set_remind', ['id' => $v.id])}" class="layui-btn layui-btn-info"><i class="fa fa-edit"></i> 已处理</a>
                        {/if}
                        <a href="{:url('user/customer/del_remind', ['id' => $v.id])}" class="layui-btn layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
                    </td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <div class="page">{$list->render()}</div>
    </div>
</div>
{/block}